Running External Programs from Within Alpha Anywhere Using .NET

Description

A common requirement is to run external programs from with Alpha Anywhere. Xbasic has had the sys_shell() and sys_shell_wait() command for many versions, but you can also use .Net framework methods.

Discussion

External programs can be run from within Alpha Anywhere using the .NET framework using the System::Diagnostics::Process::Start() method. For example, say you want to log onto a VPN programmatically from within Alpha Anywhere:

System::Diagnostics::Process::Start("rasdial.exe", "MyVPN MyUsername MyPassword")

To disconnect:

System::Diagnostics::Process::Start("rasdial.exe", "MyVPN /d")